#include "ActorComponent.h"

class RenderComponent2D : public ActorComponent
{
protected:
	std::shared_ptr<ISceneNode2D> m_pSceneNode;

public:
	virtual std::shared_ptr<ISceneNode2D> VCreateSceneNode() = 0;
	virtual void VPostInit(void) override;

private:
	virtual std::shared_ptr<ISceneNode2D> VGetSceneNode();
};

class SpriteComponent : public RenderComponent2D
{
protected:
	std::wstring m_file;

public:
	static const char* g_name;
	static const ComponentId& g_ID;

	virtual const char *VGetName() const override { return g_name; }

	virtual bool VInit(tinyxml2::XMLElement* pData) override;
	virtual std::shared_ptr<ISceneNode2D> VCreateSceneNode() override;
};

extern ActorComponent* CreateSpriteComponent();